package krow.dev.gunpobus.model;

import krow.dev.gunpobus.Constants.Value;
import krow.dev.gunpobus.R;

public class RouteItem {

	private String mId;

	private String mName;

	private int mType;

	private int mIcon;

	public String getId() {
		return mId;
	}

	public void setId(String id) {
		mId = id;
	}

	public String getName() {
		return mName;
	}

	public void setName(String name) {
		mName = name;
	}

	public int getType() {
		return mType;
	}

	public void setType(int type) {
		mType = type;
		mIcon = getResourceId(type);
	}

	public int getIcon() {
		return mIcon;
	}

	private static int getResourceId(int type) {
		
		int resourceId = R.drawable.icon_bus_blue;
		
		switch (type) {
		case Value.TYPE_ROUTE_SEAT:
			resourceId = R.drawable.icon_bus_blue;
			break;
		case Value.TYPE_ROUTE_VILLAGE:
			resourceId = R.drawable.icon_bus_yellow;
			break;
		case Value.TYPE_ROUTE_DIRECT:
			resourceId = R.drawable.icon_bus_red;
			break;
		case Value.TYPE_ROUTE_GENERAL:
			resourceId = R.drawable.icon_bus_green;
			break;
		}
		
		return resourceId;
	}
}
